<template>
  <div class="box">
    <el-container :class="hp ? 'box2' : 'btn3'">
      <el-aside width="200px" v-if="show1">
        <SideMenu></SideMenu>
      </el-aside>
      <img
        v-if="show1"
        src="../assets/s2.png"
        style="
          width: 25px;
          height: 25px;
          position: absolute;
          margin-left: 205px;
          margin-top: 10px;
        "
        @click="show1 = !show1"
      />

      <img
        v-if="!show1"
        src="../assets/s1.png"
        style="
          width: 25px;
          height: 25px;
          position: absolute;
          margin-left: 10px;
          margin-top: 10px;
        "
        @click="show1 = !show1"
      />

<!--      <img
        src="../assets/hp1.png"
        style="
          width: 40px;
          height: 40px;
          position: fixed;
          top: 40px;
          right: 30px;
		  z-index: 99;
        "
        @click="hp = !hp"
      /> -->
      <el-container>
        <el-header style="display: flex; justify-content: space-between">
          <strong style="margin: auto">浩泽管理软件系统</strong>
          <div>
            <span>{{ `${userInfo.nickName}(${userInfo.roleName})` }}</span>
          </div>
          <!--        <div class="header-avatar">
          <el-button plain @click.native="logout">退出</el-button>
        </div> -->
        </el-header>

        <el-main>
          <div style="height: 100%">
            <router-view />
          </div>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
import SideMenu from "../components/SideMenu";

export default {
  name: "Home",
  components: {
    SideMenu,
  },
  data() {
    return {
      hp: false,
      show1: true,
      userInfo: {},
    };
  },
  computed: {
    // userInfo: function () {
    //   return this.$store.state.user;
    // },
  },
  created() {
    this.userInfo = JSON.parse(localStorage.getItem("userInfo"));
    // console.log('user=>',this.userInfo);
  },
  methods: {
    // logout() {
    //   this.$axios.post("/logout").then(() => {
    //     window.sessionStorage.clear();
    //     this.$store.commit("RESET_STATE");
    //     this.$router.push("/login");
    //   });
    // },
  },
};
</script>

<style scoped>
.box {
  width: 100vw;
  height: 100vh;
  position: relative;
  overscroll-behavior: none;
}
.btn3 {
  width: 100vw;
  height: 100vh;
}
.box2 {
  padding: 10px;
  transform: rotate(90deg);
  transform-origin: 0% 0%;
  position: absolute;
  /* top: 0%; */
  width: 100vh;
  left: 100%;
  height: 200vw;
  /* height: 100vh;
  margin-left: 0; */
}
.el-container {
  padding: 0;
  margin: 0;
  height: 100%;
}

.header-avatar {
  float: right;
  width: 210px;
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.el-dropdown-link {
  cursor: pointer;
}

.el-header {
  background-color: #66b1ff;
  color: #fff;
  text-align: center;
  line-height: 60px;
}

.el-aside {
  background-color: #d3dce6;
  color: #333;
  line-height: 200px;
}

.el-main {
  color: #333;
  padding: 15px;
  /* background-color: #f0f2f5; */
}

a {
  text-decoration: none;
}
</style>
